import axios from '@/api/fetch';
import SERVER from '@/api/server';
// 列表查询
export const getList = (params) => axios.post(`${SERVER.WHOLESALES}/BigCustomerOrder/queryList`, params)
// 大客户报备选择列表查询
export const getQueryList = params => axios.post(`${SERVER.WHOLESALES}/bigCustomer/querySelectListInfo`, params);
// 大客户报备-查询详情
export const getCustomerDetail = params => axios.get(`${SERVER.WHOLESALES}/bigCustomer/queryBigCustomerById`, { params });
//明细查询
export const getDetail = (params) => axios.get(`${SERVER.WHOLESALES}/BigCustomerOrder/getBigCustomerOrderById`, { params })
// 保存大客户订单
export const saveOrder = (params) => axios.post(`${SERVER.WHOLESALES}/BigCustomerOrder/saveBigCustomerOrder`, params)
// 提报大客户订单
export const submitOrder = (params) => axios.post(`${SERVER.WHOLESALES}/BigCustomerOrder/submitBigCustomerOrder`, params)
// 删除
export const deleteOrderById = (params) => axios.post(`${SERVER.WHOLESALES}/BigCustomerOrder/deleteBigCustomerOrder`,  params)

//获取订单细分类型
export const getOrderDetailType = (params) => axios.get(`${SERVER.WHOLESALES}/baseData/getFiOrderTypeSub`, { params })
// 获取所有经销商收车地址
export const getAllDealerAddress = () => axios.get(`${SERVER.WHOLESALES}/baseData/getAllDealerAddress`)
// 获取自提收车地址
export const getSelfAddress = () => axios.get(`${SERVER.WHOLESALES}/baseData/getSelfAddress`)
// / 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
//  导出
export const exportList = (params) => axios.post(`${SERVER.WHOLESALES}/BigCustomerOrder/exportOemSubmitQueryList`, params, { responseType: 'blob' })


//选中车辆树形数据
export const getProductBrandTree = params => axios.get(`${SERVER.WHOLESALES}/baseData/getProductBrandTree`, { params });
//物料信息查询-厂端
export const queryCarListOem = (params) => axios.post(`${SERVER.WHOLESALES}/baseData/queryCarListOem`, params);
//内饰外饰
export const listColor = params => axios.get(`${SERVER.WHOLESALES}/baseData/listColor`, { params });
//配置
export const queryAllOption = params => axios.get(`${SERVER.WHOLESALES}/baseData/queryAllOption`, { params });
//选配
export const queryAllPackage = params => axios.get(`${SERVER.WHOLESALES}/baseData/queryAllPackage`, { params });

// //选择车辆树形数据
// export const getProductBrandTree = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/brand/getProductBrandTree`, { params });
// // 车辆配置五级选择
// export const vehicleConfiguration = (id, params) => axios.get(`${SERVER.BASEDATA}/vehicleProduct/productInfo/productTreeNew`, { params: { type: id, level: 6, ...params } });
// //物料信息查询
// export const queryCarListSideC = (params) => axios.post(`${SERVER.DMSCLOUD_SYSBASEDATA}/vsProduct/queryCarListSideC`, params)
// //内饰外饰
// export const listColor = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/color/listColor`, { params });
// //配置
// export const queryAllOption= params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/option/vsOption/queryAllOption`, { params });
// //选配
// export const queryAllPackage= params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/option/vsOption/queryAllPackage`, { params });

// // 获取折扣详情
export const getDiscountDetails = (params) => axios.get(`${SERVER.WHOLESALES}/orderGoods/getDiscountDetails`, { params })

export const listColorTrim = params => axios.get(`${SERVER.WHOLESALES}/baseData/listColorTrim`, { params });
export const listColorOut = params => axios.get(`${SERVER.WHOLESALES}/baseData/listColorOut`, { params });


